package api

import (
	"BookStack/internal/application/article"
	"BookStack/internal/application/book"
	"BookStack/internal/application/category"
	"BookStack/internal/application/navigation"
	"BookStack/internal/application/page"
	"BookStack/internal/application/tag"
	"BookStack/internal/application/user"
)

// Handlers 处理器集合
type Handlers struct {
	// 用户模块
	UserHandler *UserHandler
	// 文章模块
	ArticleHandler *ArticleHandler
	// 书籍模块
	BookHandler        *BookHandler
	BookChapterHandler *BookChapterHandler
	BookRecycleHandler *BookRecycleHandler
	// 自定义页面模块
	PageHandler *PageHandler
	// 分类模块
	CategoryHandler *CategoryHandler
	// 标签模块
	TagHandler *TagHandler
	// 导航模块
	NavigationHandler *NavigationHandler
	// TODO: 添加其他处理器
}

// NewHandlers 创建处理器集合
func NewHandlers(
	// 用户模块
	userService user.Service,
	// 文章模块
	articleService article.Service,
	// 书籍模块
	bookService book.ApplicationService,
	// 自定义页面模块
	pageService page.Service,
	// 分类模块
	categoryService category.Service,
	// 标签模块
	tagService tag.Service,
	// 导航模块
	navigationService navigation.Service,
	// TODO: 添加其他模块
) *Handlers {
	return &Handlers{
		// 用户模块
		UserHandler: NewUserHandler(userService),
		// 文章模块
		ArticleHandler: NewArticleHandler(articleService),
		// 书籍模块
		BookHandler:        NewBookHandler(bookService),
		BookChapterHandler: NewBookChapterHandler(bookService),
		BookRecycleHandler: NewBookRecycleHandler(bookService),
		// 自定义页面模块
		PageHandler: NewPageHandler(pageService),
		// 分类模块
		CategoryHandler: NewCategoryHandler(categoryService),
		// 标签模块
		TagHandler: NewTagHandler(tagService),
		// 导航模块
		NavigationHandler: NewNavigationHandler(navigationService),
		// TODO: 初始化其他处理器
	}
}
